package com.sskj.functions.presenter;


import com.lzy.okgo.model.Response;
import com.orhanobut.logger.Logger;
import com.sskj.common.base.HttpData;
import com.sskj.functions.presenter.BasePresenter;
import com.sskj.functions.ui.fragment.FunctionsFragment;
import com.sskj.lib.bean.CertificationBean;
import com.sskj.lib.bean.FunctionsBannerBean;
import com.sskj.lib.http.JsonCallBack;

import java.util.List;

/**
 * @author Hey
 * Create at  2019/06/24
 */
public class FunctionsPresenter extends BasePresenter<FunctionsFragment> {
    public void getCertificationStatus() {
        httpService.getCertificationStatus()
                .tag(this)
                .execute(new JsonCallBack<HttpData<CertificationBean>>() {
                    @Override
                    public void onSuccess(Response<HttpData<CertificationBean>> response) {
                        mView.getStatusOK(response.body().getData());
                    }
                });
    }

    public void getBanner() {
        httpService.getBanner()
                .tag(this)
                .execute(new JsonCallBack<HttpData<List<FunctionsBannerBean>>>() {
                    @Override
                    public void onSuccess(Response<HttpData<List<FunctionsBannerBean>>> response) {
                        mView.getBannerSuccess(response.body().getData());
                    }
                });
    }
}
